import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
  title: 'Jishi project',
  tagline: 'Good foundation is the cornerstone of system stability',
  favicon: 'favicon.ico',

  // Set the production url of your site here
  url: 'https://xiaobo.li',
  // Set the /<baseUrl>/ pathname under which your site is served
  // For GitHub pages deployment, it is often '/<projectName>/'
  baseUrl: '/jishi/',

  // GitHub pages deployment config.
  // If you aren't using GitHub pages, you don't need these.
  organizationName: 'xiaob.li', // Usually your GitHub org/user name.
  projectName: 'jishi', // Usually your repo name.

  onBrokenLinks: 'throw',
  onBrokenMarkdownLinks: 'warn',

  // Even if you don't use internationalization, you can use this field to set
  // useful metadata like html lang. For example, if your site is Chinese, you
  // may want to replace "en" with "zh-Hans".
  i18n: {
    defaultLocale: 'zh-CN',
    locales: ['zh-CN','en-US']
  },

  presets: [
    [
      'classic',
      {
        docs: {
          sidebarPath: './sidebars.ts',
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          editUrl:
            'https://gitee.com/xiaobolinet/jishi-website/edit/master',
        },
        blog: {
          showReadingTime: true,
          feedOptions: {
            type: ['rss', 'atom'],
            xslt: true,
          },
          // Please change this to your repo.
          // Remove this to remove the "edit this page" links.
          editUrl:
            'https://gitee.com/xiaobolinet/jishi-website',
          // Useful options to enforce blogging best practices
          onInlineTags: 'warn',
          onInlineAuthors: 'warn',
          onUntruncatedBlogPosts: 'warn',
        },
        theme: {
          customCss: './src/css/custom.css',
        },
      } satisfies Preset.Options,
    ],
  ],

  themeConfig: {
    // Replace with your project's social card
    image: 'img/docusaurus-social-card.jpg',
    navbar: {
      title: 'Jishi project',
      logo: {
        alt: 'Link to jishi project',
        src: 'logo.svg',
      },
      items: [        
        {
          to: "intro",
          position: 'left',
          label: 'Introduction',
        },

        // {
        //   type: 'docSidebar',
        //   sidebarId: 'tutorialSidebar',
        //   position: 'left',
        //   label: 'Tutorial',
        // },

        {
          type: 'docSidebar',
          sidebarId: 'tutorialSidebar',
          label: 'Panshi',
          position: 'left',
        },
        {
          type: 'docSidebar',
          sidebarId: 'qiyuanSidebar',
          label: 'Qiyuan',
          position: 'left',
        },
        {
          type: 'docSidebar',
          sidebarId: 'nichangSidebar',
          label: 'Nichang',
          position: 'left',
        },


        // {to: '/blog', label: 'Blog', position: 'left'},

        {
          to: "issue",
          position: 'left',
          label: 'Issue',
        },

        {
          type: 'localeDropdown',
          position: 'right',
        },

        {
          href: 'https://www.gitee.com/xiaobolinet/jishi-website',
          label: 'Git',
          position: 'right',
        },
      ],
    },
    footer: {
      style: 'dark',
      links: [
        {
          title: 'Docs',
          items: [
            {
              label: 'PANSHI',
              to: '/docs/panshi/',
            },
            {
              label: 'NICHANG',
              to: '/docs/nichang/',
            },
            {
              label: 'QIYUAN',
              to: '/docs/qiyuan/',
            },
            // {
            //   label: 'Tutorial',
            //   to: '/docs/intro',
            // },
          ],
        },
        {
          title: 'Project',
          items: [
            {
              label: 'PANSHI',
              href: 'https://gitee.com/xiaobolinet/panshi',
            },
            {
              label: 'NICHANG',
              href: 'https://gitee.com/xiaobolinet/nichang',
            },
            {
              label: 'QIYUAN',
              href: 'https://gitee.com/xiaobolinet/qiyuan',
            },
          ],
        },
        {
          title: 'More',
          items: [
            {
              label: 'Xiaobo.LI',
              // to: '/blog',
              href: 'https://xiaobo.li/notes',
            }
          ],
        },
        // {
        //   title: 'Community',
        //   items: [
        //     {
        //       label: 'Stack Overflow',
        //       href: 'https://stackoverflow.com/questions/tagged/docusaurus',
        //     },
        //     {
        //       label: 'Discord',
        //       href: 'https://discordapp.com/invite/docusaurus',
        //     },
        //     {
        //       label: 'Twitter',
        //       href: 'https://twitter.com/docusaurus',
        //     },
        //   ],
        // },
        {
          title: 'More',
          items: [
            {
              label: 'Blog',
              to: '/blog',
            },
            {
              label: 'GitHub',
              href: 'https://gitee.com/xiaobolinet/jishi-website',
            },
          ],
        },
      ],
      copyright: `Copyright © ${new Date().getFullYear()} Jishi Project, Inc. Built with Docusaurus.<script>
        !function(p){"use strict";!function(t){var s=window,e=document,i=p,c="".concat("https:"===e.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),n=e.createElement("script"),r=e.getElementsByTagName("script")[0];n.type="text/javascript",n.setAttribute("charset","UTF-8"),n.async=!0,n.src=c,n.id="LA_COLLECT",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:"Jr1tVJATtEAbLDRt",ck:"Jr1tVJATtEAbLDRt"});
        </script>`,
    },
    prism: {
      theme: prismThemes.github,
      darkTheme: prismThemes.dracula,
      // theme: lightCodeTheme,
      // darkTheme: darkCodeTheme,
    },
  } satisfies Preset.ThemeConfig,
};

export default config;
